<template>
  <div class="search">
    <nav-bar :navBarData="navBarData" @clickBarItem="clickBarItem"></nav-bar>
    <div class="content">
        <router-view></router-view>
    </div>
  </div>
</template>

<script>
import NavBar from "../../components/navbar/NavBar.vue";
export default {
  name: "Search",
  components: {
    NavBar,
  },
  data() {
    return {
      navBarData: [
        {
          name: "单曲",
          path: `/search/searchSong/${this.$route.params.id}`,
        },
        {
          name: "歌手",
          path: `/search/searchSinger/${this.$route.params.id}`,
        },
        {
          name: "专辑",
          path: `/search/searchAlbum/${this.$route.params.id}`,
        },
        {
          name: "视频",
          path: `/search/searchVideo/${this.$route.params.id}`,
        },
        {
          name: "歌单",
          path: `/search/searchDetail/${this.$route.params.id}`,
        },
      ],
    };
  },

  mounted() {},

  methods: {
    clickBarItem(path) {
      //   console.log(path);
      if (path != this.$route.path) {
        this.$router.push(path);
      }
    },
  },
};
</script>

<style lang="less" scoped>
.content{
    margin-top: 20px;
}
</style>